﻿using System.Collections.Generic;
using System.Web.Mvc;
using NUnit.Framework;
using MyMovieCollection.Controllers;
using MyMovieCollection.Services.Catalog;

namespace MyMovieCollectionTests.Controllers
{
    /// <summary>
    /// Summary description for ProductControllerTest
    /// </summary>
    [TestFixture]
    public class ProductControllerTest
    {
        [Test]
        public void Index()
        {
            // Setup
            ProductController controller = new ProductController(new CatalogService());

            // Execute
            ViewResult result = controller.Index() as ViewResult;

            // Verify
            IDictionary<string, object> viewData = result.ViewData as IDictionary<string, object>;
            Assert.AreEqual("Home Page", viewData["Title"]);
            Assert.AreEqual("Welcome to ASP.NET MVC!", viewData["Message"]);
        }

        [Test]
        public void About()
        {
            // Setup
            ProductController controller = new ProductController(new CatalogService());

            // Execute
            ViewResult result = controller.About() as ViewResult;

            // Verify
            IDictionary<string, object> viewData = result.ViewData;
            Assert.AreEqual("About Page", viewData["Title"]);
        }
    }
}